import request from '@/utils/request'
import apis from './'

export function getList (parameter) {
  return request({
    url: apis.BusinessList,
    method: 'get',
    params: parameter
  })
}

export function getCount (parameter) {
  return request({
    url: `${apis.BusinessList}?type=get_count`,
    method: 'get',
    params: parameter
  })
}

export function getStatus (id) {
  return request({
    url: `${apis.BusinessList}?type=get_status2_state_items&business_id=${id}`,
    method: 'get'
  })
}

export function getDetail (id) {
  return request({
    url: `${apis.BusinessDetail}?cb_id=${id}`,
    method: 'get'
  })
}

export function getBusinessTransfer (parameter) {
  return request({
    url: apis.BusinessTransfer,
    method: 'get',
    params: parameter
  })
}

export function getBusinessMat (id) {
  return request({
    url: `${apis.BusinessMat}?business_id=${id}`,
    method: 'get'
  })
}

export function getEditSubject (id, parameter) {
  return request({
    url: `${apis.EditSubject}?cb_id=${id}`,
    method: 'get',
    params: parameter
  })
}

export function postEditSubject (id, data) {
  return request({
    url: `${apis.EditSubject}?cb_id=${id}`,
    method: 'post',
    data: data
  })
}
